home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.0
/
Video Toaster v4.0.iso
/
arexx
/
modeler
/
m2in.lwm
< prev
next >
Wrap
Text File
|
1993-12-13
|
1KB
|
59 lines
/* CMD: Meters<->Inches
* Convert between metric lengths and feet and inches */
/* By Arnie Cachelin © 1993 NewTek Inc. */
NUMERIC DIGITS 7
call addlib "LWModelerARexx.port", 0
signal on error
signal on syntax
sysnam = 'Meters<->Inches'
version = '1.0'
call req_begin sysnam
id_ft = req_addcontrol("Feet ", 'n')
id_in = req_addcontrol("Inches ", 'n')
id_m = req_addcontrol("Meters ", 'n')
call req_setval id_in, 0
call req_setval id_ft, 0
call req_setval id_m, 0
if (~req_post()) then do
call req_end
exit
end
in = req_getval(id_in)
ft = req_getval(id_ft)
m = req_getval(id_m)
if ft>0 then in=in+(12*ft)
if in>0 then do
m=.0254*in
ft=in%12
in=in//12
st="! "
if ft>0 then st=st||strip(ft,'B','0')" Feet "
if in>0 then st=st||strip(in,'B','0')" Inches "
st = st||"= "strip(m/1,'B')" Meters"
call notify(1,st)
end
else if m>0 then do
in=m/.0254
ft=in%12
in=in//12
st="! "strip(m/1,'B')" Meters = "
if ft>0 then st=st||strip(ft,'B','0')" Feet "
if in>0 then st=st||strip(in,'B','0')" Inches "
call notify(1,st)
end
call req_end
exit
syntax:
error:
call end_all
t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
exit